package br.edu.JUniversity.controllers.locale.actions;

import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;

import com.opensymphony.xwork2.ActionContext;

@Namespace(value = "/")
public class LocaleAction {
	private String idioma;

	@Action(value = "locale", results = {
			@Result(name = "ok", 
					type = "redirectAction", params = {"actionName", "home" }
			)
			}
	)
	public String locale() {
		Map session = ActionContext.getContext().getSession();
		session.put("idioma",getIdioma());
		return "ok";
	}
	
	public String getIdioma() {
		return idioma;
	}

	public void setIdioma(String idioma) {
		this.idioma = idioma;
	}
	
}
